<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:59:"D:\WWW\khcm_website\template\default\index\index_index.html";i:1515674416;s:61:"D:\WWW\khcm_website\template\default\index\public_header.html";i:1512953908;s:61:"D:\WWW\khcm_website\template\default\index\public_footer.html";i:1512782117;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="keywords" content="<?php echo "镇江建筑装饰五金,镇江机械五金件,镇江手动工具,镇江电动工具"; ?>">
    <meta name="description" content="<?php echo "镇江公司创立于2000年， 经过多年的不懈努力，公司现已经成为一家专业从事IT产品开发、生产和销售的高科技企业。公司成立几年来，一直致力于工控/服务器机箱及各种非标箱体的开发与生产，产品现广泛应用于计算机网络、监控、安防、广电、通讯和仪器设备等多种行业"; ?>">
    <title><?php echo "建筑装饰五金,机械五金件,手动工具,电动工具"; ?>-<?php echo "北京某某机械有限公司"; ?></title>
    <link rel="stylesheet" href="__PUBLIC__/css/yunu.css">
    <script type="text/javascript" src="__PUBLIC__/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/mk.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/jquery.lazyload.min.js"></script>
    <!-- <link rel="stylesheet" href="__PUBLIC__/css/wowslider1.css">
    <link rel="stylesheet" href="__PUBLIC__/css/wowslider2.css"> -->
    <link rel="stylesheet" href="__PUBLIC__/css/idangerous.swiper.css">
</head>
<body>
    <?php error_reporting(0); ?>
    <div class="header">
        <div class="center">
            <div class="head_top_content">
                <div class="head_logo fl">
                    <img src="<?php echo "/uploads/image/20170929/fbe0415ab900053aef3846e0077c1ef5.jpg"; ?>" alt="">
                    <div class="head_tit fl">
                        <h4><?php echo "北京某某机械有限公司"; ?></h4>
<?php
		$_block = db('block')->where("title='".'head_text1'."'")->find();
		$_block = update_str_dq($_block, config('sys.sys_area'));
		$_block_content = '';
		if ($_block) {
			if ($_block['type'] == 2) {
				if (!0) {
					$_block_content = '<img src="'. $_block['content'] .'" />';
				}else {
					$_block_content = $_block['content'];
				}
			}else {
				if(0) {
					$_block_content = str2sub(strip_tags($_block['content']), 0, 0);//清除html再截取
				}else {
					$_block_content = $_block['content'];
				}
			}
		}
		echo $_block_content;
?>
                    </div>
                    <div class="head_text fl">
<?php
		$_block = db('block')->where("title='".'head_text2'."'")->find();
		$_block = update_str_dq($_block, config('sys.sys_area'));
		$_block_content = '';
		if ($_block) {
			if ($_block['type'] == 2) {
				if (!0) {
					$_block_content = '<img src="'. $_block['content'] .'" />';
				}else {
					$_block_content = $_block['content'];
				}
			}else {
				if(0) {
					$_block_content = str2sub(strip_tags($_block['content']), 0, 0);//清除html再截取
				}else {
					$_block_content = $_block['content'];
				}
			}
		}
		echo $_block_content;
?>
                    </div>
                </div>
                <div class="fr">
                    <img src="__PUBLIC__/img/ren.png" alt="">
                    <?php
		$_block = db('block')->where("title='".'head_text3'."'")->find();
		$_block = update_str_dq($_block, config('sys.sys_area'));
		$_block_content = '';
		if ($_block) {
			if ($_block['type'] == 2) {
				if (!0) {
					$_block_content = '<img src="'. $_block['content'] .'" />';
				}else {
					$_block_content = $_block['content'];
				}
			}else {
				if(0) {
					$_block_content = str2sub(strip_tags($_block['content']), 0, 0);//清除html再截取
				}else {
					$_block_content = $_block['content'];
				}
			}
		}
		echo $_block_content;
?>
                </div>
            </div>
            <div class="head_nav">
                <ul>
                    <li><a href="<?php echo "http://www.website.cn/"; ?>" <?php if(!isset($cid)): ?>class="active"<?php endif; ?>>网站首页</a></li>
                    <?php
		$_limit = "10";
		$_typeid = intval('1');
		
		$_category = new app\index\model\CategoryModel();
		$_navlist = $_category->getCategory('', $_typeid, false);
		

		$_navlist  = $_category->unlimitedForLayer($_navlist);

		foreach($_navlist as $autoindex => $nav):
			$_limit_list = explode(',', $_limit);
			if(count($_limit_list) > 1){
				if(($autoindex < $_limit_list[0]) || ($autoindex > $_limit_list[1])) continue;
			} else{
				if($autoindex >= $_limit) break;
			}
			$nav['target'] = $nav['target'] ? '_blank' : '_self';
			$nav['url'] = $_category->getCategoryUrl($nav, []);

			$nav = update_str_dq($nav, config('sys.sys_area'));

?>
                    <li><a href="<?php echo $nav['url']; ?>" <?php if($nav['id'] == $cid): ?>class="active"<?php endif; ?> target="<?php echo $nav['target']; ?>"><?php echo $nav['title']; ?></a></li>
                    <?php endforeach;?>
                </ul>
            </div>
        </div>
    </div>

    <?php if(!is_array(1)): ?>
    <div class="banner">
        <div class="banner_img" id="wowslider-container">
            <div class="ws_images" id="banner">
                <ul>
                    <?php
		$_type = '1';
		
		$_where = [];
		if ($_type) {
			$_where['type'] = $_type;
		}

		$_limit = "10";
		$_infolist = db('banner')->where($_where)->order("sort desc")->limit($_limit)->select();

		foreach ($_infolist as $k => $banner):
			$banner = update_str_dq($banner, config('sys.sys_area'));
?>		
                    <li>
                    <a href="<?php echo $banner['url']; ?>"><img src="<?php echo $banner['pic']; ?>" alt="<?php echo $banner['title']; ?>" width="1920" height="550"></a>
                    </li>
                    <?php endforeach;?>
                </ul>
            </div>
            <!-- <div class="ws_bullets">
                <div>
                    <a href="javascript:;">
                        <span>1</span>
                    </a>
                    <a href="javascript:;">
                        <span>2</span>
                    </a>
                </div>
            </div>
            <div class="ws_shadow"></div> -->
        </div>
        <!-- <script type="text/javascript" src="__PUBLIC__/js/wowslider.js"></script>
        <script type="text/javascript" src="__PUBLIC__/js/script.js"></script> -->
        <div class="banner_text">
            <div class=" center">
                <div class="banner_text_content">
                    <img class="imgleft" id="imgleft" src="__PUBLIC__/img/jb.png" alt="">
                    <div class="banner_text_bg">
                        <?php
		$_block = db('block')->where("title='".'banner_text'."'")->find();
		$_block = update_str_dq($_block, config('sys.sys_area'));
		$_block_content = '';
		if ($_block) {
			if ($_block['type'] == 2) {
				if (!0) {
					$_block_content = '<img src="'. $_block['content'] .'" />';
				}else {
					$_block_content = $_block['content'];
				}
			}else {
				if(0) {
					$_block_content = str2sub(strip_tags($_block['content']), 0, 0);//清除html再截取
				}else {
					$_block_content = $_block['content'];
				}
			}
		}
		echo $_block_content;
?>
                    </div>
                    <script type="text/javascript">
                        $(document).ready(function(){
                            $('#banner').roll({
                                height: 550,
                                banner: true,
                                btn: true,
                                center: false
                            });
                            $('#imgleft').animate({left: "0"},1000);
                            $('#pbottom').animate({top: "0"},1000);
                            $('#fonts').animate({fontSize: "43px"},1000);
                            $('#fonts').animate({opacity: "1"},2000);
                        });
                    </script>
                </div>
            </div>
        </div>
    </div>
    <?php else: ?>
    <div class="page_banner">
        <?php
		$_block = db('block')->where("title='".'page_banner'."'")->find();
		$_block = update_str_dq($_block, config('sys.sys_area'));
		$_block_content = '';
		if ($_block) {
			if ($_block['type'] == 2) {
				if (!0) {
					$_block_content = '<img src="'. $_block['content'] .'" />';
				}else {
					$_block_content = $_block['content'];
				}
			}else {
				if(0) {
					$_block_content = str2sub(strip_tags($_block['content']), 0, 0);//清除html再截取
				}else {
					$_block_content = $_block['content'];
				}
			}
		}
		echo $_block_content;
?>
    </div>
    <?php endif; ?>

    <div class="main">
        <div class="i_box1 clearfix">
            <div class="center">
                <div class="i_box1_content">
                    <div class="main_l fl">
                        <p>
                            <span>产品分类</span>
                            <i>PRODUCT DISPLAY</i>
                        </p>
                        <ul>
                            <?php
		$_limit = "10";
		$_cid = intval(21);
		$_type = "son";
		
		$_category = new app\index\model\CategoryModel();
		if($_cid == -1) $_cid = input('cid');
		$_catlist = $_category->getCategory(1);

		if (1 == 0) {
			$_catlist = $_category->clearLink($_catlist);//去除外部链接的栏目
		}
		//type为parent
		if ($_type == 'parent') {
			$_parent  = $_category->getParents($_catlist, $_cid);
			$_catlist  = $_category->unlimitedForLayer($_catlist, 'child', $_parent[0]['id']);

		}else{
			//type为top,忽略cid
			if($_cid == 0 || $_type == 'top') {
				$_catlist  = $_category->unlimitedForLayer($_catlist);
			}else {
				
				if ($_type == 'self') {
					//同级分类
					$_typeinfo  = $_category->getSelf($_catlist, $_cid );
					$_catlist  = $_category->unlimitedForLayer($_catlist, 'child', $_typeinfo['pid']);
				}else {
					//son，子类列表
					$_catlist  = $_category->unlimitedForLayer($_catlist, 'child', $_cid);
				}
			}
		}
		
		$_limit_list = explode(',', $_limit);
		foreach($_catlist as $autoindex => $catlist):
			if(count($_limit_list) > 1){
				if(($autoindex < $_limit_list[0]) || ($autoindex > $_limit_list[1])) continue;
			} else{
				if($autoindex >= $_limit_list[0]) break;
			}
			$catlist = update_str_dq($catlist, config('sys.sys_area'));
?>
                            <li><a href="<?php echo $catlist['url']; ?>"><span><?php echo $catlist['title']; ?></span></a></li>
                            <?php endforeach;?>
                        </ul>
                        <div class="contact">
                            <a href="javascript:;">
                                <img data-original="__PUBLIC__/img/88.png" alt="">
                                <h3>在线留言</h3>
                                <span>留下您的宝贵意见</span>
                            </a>
                        </div>
                    </div>
                    <div class="main_r fr pro_list">
                        <ul>
                            <?php
$_cid = 21;

		$_limit = "8";
		$_keyword = -1;
		$_flag = '1';
		$_top = '';
		$_pagesize = 0;
		$_tag = -1;


		if($_cid == -1) $_cid = input('cid');
		if ($_cid > 0 || substr($_cid, 0, 1) == '$') {
			
			$_category = new app\index\model\CategoryModel();
			if (strpos($_cid, ',')) {
				$_cidarr = explode(',', $_cid); 
				$_ids = [];
				foreach ($_cidarr as $_k => $_v) {
					$_ids = array_merge($_ids, $_category->getChildsId($_category->getCategory(), $_v, true));
				}
			}else{
				$_ids = $_category->getChildsId($_category->getCategory(), $_cid, true);
			}
			
			$_where = array('create_time' => array('LT', time()), 'cid'=> array('IN', $_ids));
		}else {
			$_where = array('create_time' => array('LT', time()));
		}
		if ($_keyword != -1) {
			$_where['title'] = array('LIKE','%'.$_keyword.'%');
		}

		if ($_flag) {	
			$_where['istop'] = $_flag;
		}
		if ($_top) {	
			$_where['top'] = $_top;
		}
		if ($_tag != -1) {
			$_jgf = ',';
			$_jgf = strpos($_title, '，') ? '，' : $_jgf;
			$_taglist = explode($_jgf,$_tag);
			if (count($_taglist) > 1) {
				$_tagarr = array();
				foreach ($_taglist as $_k => $_v) {
					$_tagarr[] = ['LIKE','%'.$_v.'%'];
				}
				$_tagarr[] = 'or';
				$_where['tag'] = $_tagarr;
			}else{
				$_where['tag'] = ['LIKE','%'.$_tag.'%'];
			}
		}

		$_where['create_time'] = ['LT', time()];
		//地区独立内容
	    $_area = config('sys.sys_area') ? db('area')->where(['etitle'=>config('sys.sys_area')])->find() : [];
	    if ($_area) {
	    	$_where['area'] = [['exp',' is NULL'],['eq',''],['LIKE','%,'.$_area['id'].',%'], 'or'];
	    }else{
	    	$_where['area'] = [['exp',' is NULL'],['eq',''], 'or'];
	    }
		
		$page = "";//分页
		if ($_pagesize > 0) {
			$_pagearr = [];
			switch (config('sys.url_model')) {
		    	case '1'://动态
		    		$_pagearr = ['query' => request()->param()];
		    		break;
		    	case '3'://伪静态
		    		$_pagearr = ['path' => ''];
		    		break;
		    }

			$_infolist = db('content')->where($_where)->order("sort desc")->paginate($_pagesize, false , $_pagearr);//, false, ['query' => ['catid' => 1]]
        	$page = $_infolist->render();
        	if (config('sys.url_model') == 3 && $_area) {
        		if ($_area['isurl'] == 0) {
        			$_ctitle = input('ctitle', '', 'trim');
        			$page = str_replace($_ctitle."/", $_area['etitle'].'_'.$_ctitle."/", $page);
        		}
        	}
		}else {
			
			$_infolist = db('content')->where($_where)->order("sort desc")->limit($_limit)->select();
		}
		$_content = new app\index\model\ContentModel();

		foreach ($_infolist as $k => $list):
			$list = $_content->getContentByCon($list);

			$list['alltitle'] = $list['title'];
			if(0) $list['title'] = str2sub($list['title'], 0, 0);
			$list = $_content->getContentArea($list);
			$list = update_str_dq($list, config('sys.sys_area'));
?>		
                            <li>
                                <a href="<?php echo $list['url']; ?>">
                                    <img data-original="<?php echo $list['pic']; ?>" alt="<?php echo $list['title']; ?>" width="180" height="190" img-Auto="true">
                                    <span><?php echo $list['title']; ?></span>
                                </a>
                            </li>
                            <?php endforeach;?> 
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="i_box2">
            <div class="center">
                <?php
		$_type = "son";
		$_typeid = intval(20);
		
		$_category = new app\index\model\CategoryModel();
		$_catlist = $_category->getCategory(1);
		if ($_type == 'parent') {
			$_parent  = $_category->getParents($_catlist, $_typeid);
			$_typeid  = $_parent[0]['id'];
		}

		$type = $_category->getOneCategory($_typeid);
		$type['url'] = $_category->getCategoryUrl($type);
		$type = update_str_dq($type, config('sys.sys_area'));
?>
                <div class="i_box2_tit">
                    <p><i><?php echo $type['title']; ?> / <?php echo $type['subtitle']; ?></i></p>
                    <span></span>
                </div>
                <div class="i_box2_content clearfix">
                    <div class="i_box2_content1 fl">
                        <div class="flimg">
                            <img data-original="__PUBLIC__/img/img1.png" alt="">
                        </div>
                        <div class="i_box2_img fl">
                            <img data-original="<?php echo $type['pic']; ?>" alt="">
                        </div>
                        <div class="i_box2_text fl">
                            <p><?php echo $type['desc']; ?><a href="<?php echo $type['url']; ?>">【详细介绍】</a></p>
                        </div>
                        <div class="i_box2_menu fl">
                            <?php
		$_type = "son";
		$_typeid = intval(20);
		
		$_category = new app\index\model\CategoryModel();
		$_catlist = $_category->getCategory(1);
		if ($_type == 'parent') {
			$_parent  = $_category->getParents($_catlist, $_typeid);
			$_typeid  = $_parent[0]['id'];
		}

		$type = $_category->getOneCategory($_typeid);
		$type['url'] = $_category->getCategoryUrl($type);
		$type = update_str_dq($type, config('sys.sys_area'));
?><a href="<?php echo $type['url']; ?>">公司简介</a>
                            <?php
		$_type = "son";
		$_typeid = intval(30);
		
		$_category = new app\index\model\CategoryModel();
		$_catlist = $_category->getCategory(1);
		if ($_type == 'parent') {
			$_parent  = $_category->getParents($_catlist, $_typeid);
			$_typeid  = $_parent[0]['id'];
		}

		$type = $_category->getOneCategory($_typeid);
		$type['url'] = $_category->getCategoryUrl($type);
		$type = update_str_dq($type, config('sys.sys_area'));
?><a href="<?php echo $type['url']; ?>">联系方式</a>
                            <a href="javascript:;">在线留言</a>
                        </div>
                    </div>
                    <div class="fr">
                        <div class="i_box2_fr_img">
                            <div class="swiper-container">
                                <div class="swiper-wrapper">
                                    <?php
$_cid = 34;

		$_limit = "10";
		$_keyword = -1;
		$_flag = '1';
		$_top = '';
		$_pagesize = 0;
		$_tag = -1;


		if($_cid == -1) $_cid = input('cid');
		if ($_cid > 0 || substr($_cid, 0, 1) == '$') {
			
			$_category = new app\index\model\CategoryModel();
			if (strpos($_cid, ',')) {
				$_cidarr = explode(',', $_cid); 
				$_ids = [];
				foreach ($_cidarr as $_k => $_v) {
					$_ids = array_merge($_ids, $_category->getChildsId($_category->getCategory(), $_v, true));
				}
			}else{
				$_ids = $_category->getChildsId($_category->getCategory(), $_cid, true);
			}
			
			$_where = array('create_time' => array('LT', time()), 'cid'=> array('IN', $_ids));
		}else {
			$_where = array('create_time' => array('LT', time()));
		}
		if ($_keyword != -1) {
			$_where['title'] = array('LIKE','%'.$_keyword.'%');
		}

		if ($_flag) {	
			$_where['istop'] = $_flag;
		}
		if ($_top) {	
			$_where['top'] = $_top;
		}
		if ($_tag != -1) {
			$_jgf = ',';
			$_jgf = strpos($_title, '，') ? '，' : $_jgf;
			$_taglist = explode($_jgf,$_tag);
			if (count($_taglist) > 1) {
				$_tagarr = array();
				foreach ($_taglist as $_k => $_v) {
					$_tagarr[] = ['LIKE','%'.$_v.'%'];
				}
				$_tagarr[] = 'or';
				$_where['tag'] = $_tagarr;
			}else{
				$_where['tag'] = ['LIKE','%'.$_tag.'%'];
			}
		}

		$_where['create_time'] = ['LT', time()];
		//地区独立内容
	    $_area = config('sys.sys_area') ? db('area')->where(['etitle'=>config('sys.sys_area')])->find() : [];
	    if ($_area) {
	    	$_where['area'] = [['exp',' is NULL'],['eq',''],['LIKE','%,'.$_area['id'].',%'], 'or'];
	    }else{
	    	$_where['area'] = [['exp',' is NULL'],['eq',''], 'or'];
	    }
		
		$page = "";//分页
		if ($_pagesize > 0) {
			$_pagearr = [];
			switch (config('sys.url_model')) {
		    	case '1'://动态
		    		$_pagearr = ['query' => request()->param()];
		    		break;
		    	case '3'://伪静态
		    		$_pagearr = ['path' => ''];
		    		break;
		    }

			$_infolist = db('content')->where($_where)->order("sort desc")->paginate($_pagesize, false , $_pagearr);//, false, ['query' => ['catid' => 1]]
        	$page = $_infolist->render();
        	if (config('sys.url_model') == 3 && $_area) {
        		if ($_area['isurl'] == 0) {
        			$_ctitle = input('ctitle', '', 'trim');
        			$page = str_replace($_ctitle."/", $_area['etitle'].'_'.$_ctitle."/", $page);
        		}
        	}
		}else {
			
			$_infolist = db('content')->where($_where)->order("sort desc")->limit($_limit)->select();
		}
		$_content = new app\index\model\ContentModel();

		foreach ($_infolist as $k => $list):
			$list = $_content->getContentByCon($list);

			$list['alltitle'] = $list['title'];
			if(0) $list['title'] = str2sub($list['title'], 0, 0);
			$list = $_content->getContentArea($list);
			$list = update_str_dq($list, config('sys.sys_area'));
?>		
                                    <div class="swiper-slide">
                                        <div class="title"><img data-original="<?php echo $list['pic']; ?>" alt="<?php echo $list['title']; ?>"></div>
                                    </div>
                                    <?php endforeach;?>
                                </div>
                                <div class="pagination"></div>
                            </div>
                            <script src="__PUBLIC__/js/idangerous.swiper.min.js"></script>
                            <script type="text/javascript">
                                var mySwiper = new Swiper('.swiper-container',{
                                    height: 350,
                                    pagination: '.pagination',
                                    paginationClickable: true
                                })
                                function randomColor () {
                                    var colors = ('blue red green orange pink').split(' ');
                                    return colors[ Math.floor( Math.random()*colors.length ) ]
                                }
                            </script>
                        </div>
                    </div>
                </div>
                
            </div>
        </div>
        <div class="i_box3">
            <div class="center">
                <?php
		$_type = "son";
		$_typeid = intval(29);
		
		$_category = new app\index\model\CategoryModel();
		$_catlist = $_category->getCategory(1);
		if ($_type == 'parent') {
			$_parent  = $_category->getParents($_catlist, $_typeid);
			$_typeid  = $_parent[0]['id'];
		}

		$type = $_category->getOneCategory($_typeid);
		$type['url'] = $_category->getCategoryUrl($type);
		$type = update_str_dq($type, config('sys.sys_area'));
?>
                <div class="i_box3_tit">
                    <p><?php echo $type['title']; ?> / <?php echo $type['subtitle']; ?></p>
                </div>
                <div class="i_box3_content" id="marquee1">
                    <ul>
                        <?php
$_cid = $type['id'];

		$_limit = "10";
		$_keyword = -1;
		$_flag = '1';
		$_top = '';
		$_pagesize = 0;
		$_tag = -1;


		if($_cid == -1) $_cid = input('cid');
		if ($_cid > 0 || substr($_cid, 0, 1) == '$') {
			
			$_category = new app\index\model\CategoryModel();
			if (strpos($_cid, ',')) {
				$_cidarr = explode(',', $_cid); 
				$_ids = [];
				foreach ($_cidarr as $_k => $_v) {
					$_ids = array_merge($_ids, $_category->getChildsId($_category->getCategory(), $_v, true));
				}
			}else{
				$_ids = $_category->getChildsId($_category->getCategory(), $_cid, true);
			}
			
			$_where = array('create_time' => array('LT', time()), 'cid'=> array('IN', $_ids));
		}else {
			$_where = array('create_time' => array('LT', time()));
		}
		if ($_keyword != -1) {
			$_where['title'] = array('LIKE','%'.$_keyword.'%');
		}

		if ($_flag) {	
			$_where['istop'] = $_flag;
		}
		if ($_top) {	
			$_where['top'] = $_top;
		}
		if ($_tag != -1) {
			$_jgf = ',';
			$_jgf = strpos($_title, '，') ? '，' : $_jgf;
			$_taglist = explode($_jgf,$_tag);
			if (count($_taglist) > 1) {
				$_tagarr = array();
				foreach ($_taglist as $_k => $_v) {
					$_tagarr[] = ['LIKE','%'.$_v.'%'];
				}
				$_tagarr[] = 'or';
				$_where['tag'] = $_tagarr;
			}else{
				$_where['tag'] = ['LIKE','%'.$_tag.'%'];
			}
		}

		$_where['create_time'] = ['LT', time()];
		//地区独立内容
	    $_area = config('sys.sys_area') ? db('area')->where(['etitle'=>config('sys.sys_area')])->find() : [];
	    if ($_area) {
	    	$_where['area'] = [['exp',' is NULL'],['eq',''],['LIKE','%,'.$_area['id'].',%'], 'or'];
	    }else{
	    	$_where['area'] = [['exp',' is NULL'],['eq',''], 'or'];
	    }
		
		$page = "";//分页
		if ($_pagesize > 0) {
			$_pagearr = [];
			switch (config('sys.url_model')) {
		    	case '1'://动态
		    		$_pagearr = ['query' => request()->param()];
		    		break;
		    	case '3'://伪静态
		    		$_pagearr = ['path' => ''];
		    		break;
		    }

			$_infolist = db('content')->where($_where)->order("sort desc")->paginate($_pagesize, false , $_pagearr);//, false, ['query' => ['catid' => 1]]
        	$page = $_infolist->render();
        	if (config('sys.url_model') == 3 && $_area) {
        		if ($_area['isurl'] == 0) {
        			$_ctitle = input('ctitle', '', 'trim');
        			$page = str_replace($_ctitle."/", $_area['etitle'].'_'.$_ctitle."/", $page);
        		}
        	}
		}else {
			
			$_infolist = db('content')->where($_where)->order("sort desc")->limit($_limit)->select();
		}
		$_content = new app\index\model\ContentModel();

		foreach ($_infolist as $k => $list):
			$list = $_content->getContentByCon($list);

			$list['alltitle'] = $list['title'];
			if(0) $list['title'] = str2sub($list['title'], 0, 0);
			$list = $_content->getContentArea($list);
			$list = update_str_dq($list, config('sys.sys_area'));
?>		
                        <li><a href="<?php echo $list['url']; ?>"><img data-original="<?php echo $list['pic']; ?>" alt="<?php echo $list['title']; ?>"></a></li>
                        <?php endforeach;?>
                    </ul>
                </div>
                <script src="__PUBLIC__/js/jquery.kxbdMarquee.js"></script>
                <script type="text/javascript">
                    (function(){
                        $("#marquee1").kxbdMarquee({direction:"left"});
                    })();
                </script>
                <div class="i_box3_a">
                    <a href="<?php echo $type['url']; ?>">MORE+</a>
                </div>
                
            </div>
        </div>
        <div class="i_box4 clearfix">
            <div class="center">
                <div class="i_box4_content">
                    <div class="new_list fl">
                        <ul>
                            <?php
$_cid = 28;

		$_limit = "5";
		$_keyword = -1;
		$_flag = '1';
		$_top = '';
		$_pagesize = 0;
		$_tag = -1;


		if($_cid == -1) $_cid = input('cid');
		if ($_cid > 0 || substr($_cid, 0, 1) == '$') {
			
			$_category = new app\index\model\CategoryModel();
			if (strpos($_cid, ',')) {
				$_cidarr = explode(',', $_cid); 
				$_ids = [];
				foreach ($_cidarr as $_k => $_v) {
					$_ids = array_merge($_ids, $_category->getChildsId($_category->getCategory(), $_v, true));
				}
			}else{
				$_ids = $_category->getChildsId($_category->getCategory(), $_cid, true);
			}
			
			$_where = array('create_time' => array('LT', time()), 'cid'=> array('IN', $_ids));
		}else {
			$_where = array('create_time' => array('LT', time()));
		}
		if ($_keyword != -1) {
			$_where['title'] = array('LIKE','%'.$_keyword.'%');
		}

		if ($_flag) {	
			$_where['istop'] = $_flag;
		}
		if ($_top) {	
			$_where['top'] = $_top;
		}
		if ($_tag != -1) {
			$_jgf = ',';
			$_jgf = strpos($_title, '，') ? '，' : $_jgf;
			$_taglist = explode($_jgf,$_tag);
			if (count($_taglist) > 1) {
				$_tagarr = array();
				foreach ($_taglist as $_k => $_v) {
					$_tagarr[] = ['LIKE','%'.$_v.'%'];
				}
				$_tagarr[] = 'or';
				$_where['tag'] = $_tagarr;
			}else{
				$_where['tag'] = ['LIKE','%'.$_tag.'%'];
			}
		}

		$_where['create_time'] = ['LT', time()];
		//地区独立内容
	    $_area = config('sys.sys_area') ? db('area')->where(['etitle'=>config('sys.sys_area')])->find() : [];
	    if ($_area) {
	    	$_where['area'] = [['exp',' is NULL'],['eq',''],['LIKE','%,'.$_area['id'].',%'], 'or'];
	    }else{
	    	$_where['area'] = [['exp',' is NULL'],['eq',''], 'or'];
	    }
		
		$page = "";//分页
		if ($_pagesize > 0) {
			$_pagearr = [];
			switch (config('sys.url_model')) {
		    	case '1'://动态
		    		$_pagearr = ['query' => request()->param()];
		    		break;
		    	case '3'://伪静态
		    		$_pagearr = ['path' => ''];
		    		break;
		    }

			$_infolist = db('content')->where($_where)->order("sort desc")->paginate($_pagesize, false , $_pagearr);//, false, ['query' => ['catid' => 1]]
        	$page = $_infolist->render();
        	if (config('sys.url_model') == 3 && $_area) {
        		if ($_area['isurl'] == 0) {
        			$_ctitle = input('ctitle', '', 'trim');
        			$page = str_replace($_ctitle."/", $_area['etitle'].'_'.$_ctitle."/", $page);
        		}
        	}
		}else {
			
			$_infolist = db('content')->where($_where)->order("sort desc")->limit($_limit)->select();
		}
		$_content = new app\index\model\ContentModel();

		foreach ($_infolist as $k => $list):
			$list = $_content->getContentByCon($list);

			$list['alltitle'] = $list['title'];
			if(0) $list['title'] = str2sub($list['title'], 0, 0);
			$list = $_content->getContentArea($list);
			$list = update_str_dq($list, config('sys.sys_area'));
?>		
                            <li>
                                <div class="i_box4_time fl">
                                    <p>
                                        <span><?php echo date('d',$list['update_time']); ?></span>
                                        <i><?php echo date('Y-m',$list['update_time']); ?></i>
                                    </p>
                                </div>
                                <div class="i_box4_text fl">
                                    <a href="<?php echo $list['url']; ?>"><span><?php echo $list['title']; ?></span></a>
                                    <p><?php echo str2sub($list['desc'],30, true); ?></p>
                                </div>
                            </li>
                            <?php endforeach;?>
                        </ul>
                    </div>
                    <div class="fr">
                        <h3>联系方式 / CONTACT</h3>
                        <p><img src="/template/default/index/img/dz.png" alt=""><span>地址：香港XXXXXX街XXX号XXX大厦XXXXX室</span></p>
                        <p><img src="/template/default/index/img/dh.png" alt=""><span>电话：010-12345678</span></p>
                        <p><img src="/template/default/index/img/sj.png" alt=""><span>手机：13888888888</span></p>
                        <p><img src="/template/default/index/img/yx.png" alt=""><span>邮箱：88888888@qq.com</span></p>
                        <div class="map">
                            <script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script>
                            <div style="width:240px;height:240px;border:#ccc solid 1px;" id="dituContent"></div>
                            <script type="text/javascript">
                                //创建和初始化地图函数：
                                function initMap(){
                                    createMap();//创建地图
                                    setMapEvent();//设置地图事件
                                    //向地图添加控件
                                }
                                function createMap(){
                                    var map = new BMap.Map("dituContent");//在百度地图容器中创建一个地图
                                    var point = new BMap.Point(<?php
		$_block = db('block')->where("title='".'map'."'")->find();
		$_block = update_str_dq($_block, config('sys.sys_area'));
		$_block_content = '';
		if ($_block) {
			if ($_block['type'] == 2) {
				if (!0) {
					$_block_content = '<img src="'. $_block['content'] .'" />';
				}else {
					$_block_content = $_block['content'];
				}
			}else {
				if(0) {
					$_block_content = str2sub(strip_tags($_block['content']), 0, 0);//清除html再截取
				}else {
					$_block_content = $_block['content'];
				}
			}
		}
		echo $_block_content;
?>);//定义一个中心点坐标
                                    map.centerAndZoom(point,17);//设定地图的中心点和坐标并将地图显示在地图容器中
                                    window.map = map;//将map变量存储在全局
                                }

                                //地图事件设置函数：
                                function setMapEvent(){
                                    map.enableDragging();//启用地图拖拽事件，默认启用(可不写)
                                    map.enableScrollWheelZoom();//启用地图滚轮放大缩小
                                    map.enableDoubleClickZoom();//启用鼠标双击放大，默认启用(可不写)
                                    map.enableKeyboard();//启用键盘上下左右键移动地图
                                }

                                //地图控件添加函数：
                                function addMapControl(){
                                    //向地图中添加缩放控件
                                var ctrl_nav = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});
                                map.addControl(ctrl_nav);
                                    //向地图中添加缩略图控件
                                var ctrl_ove = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:1});
                                map.addControl(ctrl_ove);
                                    //向地图中添加比例尺控件
                                var ctrl_sca = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});
                                map.addControl(ctrl_sca);
                                }


                                initMap();//创建和初始化地图
                            </script>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="flink">
            <div class="center">
                <div class="flink_tit">
                    <p></p>
                    <span>友情链接 LINKS</span>
                </div>
                <div class="flink_list">
                    <ul>
                        <?php
		$_type = '1';
		$_flag = '';
		
		$_where = [];
		if ($_type) {
			$_where['type'] = $_type;
		}

		if ($_flag) {	
			$_where['pic'] = $_flag ? array('NEQ', '') : array('EQ', '');
		}

		//地区独立内容
	    $_area = config('sys.sys_area') ? db('area')->where(['etitle'=>config('sys.sys_area')])->find() : [];
	    if ($_area) {
	    	//$_where['area'] = [['exp',' is NULL'],['eq',''], ['LIKE','%,'.$_area['id'].',%'], 'or'];
	    	$_where['area'] = ['LIKE','%,'.$_area['id'].',%'];
	    }

		$_limit = "10";
		$_infolist = db('link')->where($_where)->order("id DESC")->limit($_limit)->select();

		foreach ($_infolist as $k => $link):
			$link = update_str_dq($link, config('sys.sys_area'));
?>		
                        <li><a href="<?php echo $link['url']; ?>"><?php echo $link['title']; ?></a></li>
                        <?php endforeach;?>
                    </ul>
                </div>
                <div class="flink_tit mt30">
                    <p></p>
                    <span>城市分站 CITYS</span>
                </div>
                <div class="flink_list">
                    <ul>
                        <?php
		$_limit = "10";
		$_top = intval('1');
		$_con = intval('0');
		$_url = intval('0');
		$_pid = 0;
		$_conurl = intval('');
		$_type = 'level';

		$_where = [];
		if ($_top) {
			$_where['istop'] = $_top;
		}
		if ($_con) {
			$_where['iscon'] = $_con;
		}
		if ($_url) {
			$_where['isurl'] = $_url;
		}
		
		if ($_type == "current") {
			if ($_area) {
				$_where['id'] = $_area['id'];
			}
		}

		if ($_type == -1 || $_type == "group" || $_type == "1" ) {
		    $_area = config('sys.sys_area') ? db('area')->where(['etitle'=>config('sys.sys_area')])->find() : [];
		    if ($_area) {
		    	$_where['pid'] = $_area['id'];
		    }else{
		    	$_where['pid'] = $_pid ? $_pid : 0;
		    }
		}
	    
		$_limit = "10";
		
		$_infolist = db('area')->where($_where)->order("sort asc")->limit($_limit)->select();

		if (empty($_infolist)) {
			if ($_area) {
				$_where['pid'] = $_area['pid'];
				$_infolist = db('area')->where($_where)->order("sort asc")->limit($_limit)->select();
			}
		}
		
		

		$_area = new app\index\model\AreaModel();
		$_category = new app\index\model\CategoryModel();
		$_content = new app\index\model\ContentModel();
		foreach($_infolist as $autoindex => $area):
			if ($_conurl) {
				$area['url'] = $_area->getAreaUrl($area);
			}else{
				if (isset($content)) {
					$_data = $_content->getContentArea($content, $area);
					$area['url'] = $_data['url'];
					$area['ys_title'] = $area['title'];
					$area['title'] = $area['stitle'].$content['ys_title'];
				}else{
					if (isset($category)){
						$_data = $_category->getCategoryArea($category, $area);
						$area['url'] = $_data['url'];
						$area['ys_title'] = $area['title'];
						$area['title'] = $area['stitle'].$category['ys_title'];
					}else{
						$area['url'] = $_area->getAreaUrl($area);
					}
				}
			}
			
?>
                        <li><a href="<?php echo $area['url']; ?>"><?php echo $area['title']; ?></a></li>
                        <?php endforeach;?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="footer">
        <div class="center clearfix">
            <div class="fl">
                <?php
		$_block = db('block')->where("title='".'logo2'."'")->find();
		$_block = update_str_dq($_block, config('sys.sys_area'));
		$_block_content = '';
		if ($_block) {
			if ($_block['type'] == 2) {
				if (!0) {
					$_block_content = '<img src="'. $_block['content'] .'" />';
				}else {
					$_block_content = $_block['content'];
				}
			}else {
				if(0) {
					$_block_content = str2sub(strip_tags($_block['content']), 0, 0);//清除html再截取
				}else {
					$_block_content = $_block['content'];
				}
			}
		}
		echo $_block_content;
?>
                <div class="foot_contact">
<?php echo "<p>TEL：010-88888888   MOB:13888888888  EMAIL：66666666@qq.com</p>
<p>公司地址：某某市某某区某某路建材产业总部基地</p>
<p>版权所有：某某建筑建材有限公司    ICP8888888</p>
<p>Powered by <a href=\"http://www.yunucms.com/\" target=\"_blank\">YUNUCMSv1.0.6</a></p>"; ?>
                </div>
            </div>
            <div class="fr">
                <?php
		$_block = db('block')->where("title='".'ewm'."'")->find();
		$_block = update_str_dq($_block, config('sys.sys_area'));
		$_block_content = '';
		if ($_block) {
			if ($_block['type'] == 2) {
				if (!0) {
					$_block_content = '<img src="'. $_block['content'] .'" />';
				}else {
					$_block_content = $_block['content'];
				}
			}else {
				if(0) {
					$_block_content = str2sub(strip_tags($_block['content']), 0, 0);//清除html再截取
				}else {
					$_block_content = $_block['content'];
				}
			}
		}
		echo $_block_content;
?>
            </div>
        </div>
    </div>

<script type="text/javascript">
    $("img[data-original]").lazyload({
        effect : "fadeIn",
        threshold : 300,
        load: function(){
            var t = $(this);
            if (t.attr('img-Auto')) {
                t.imgAuto();
            }
        }
    });
</script>
</body>
</html>
